#!/bin/sh

build_dev(){
#  git pull origin master
  mvn clean package -Dmaven.test.skip=true
}

run_dev(){

  PID=`ps -ef |grep modules-tools-checkanswer |grep -v "depoly" |grep -v "grep"|awk '{print $2}'`
  echo $PID
  echo "-------stoping--------"
  for pid in ${PID}
  do
  kill -9 ${pid}
  echo "killed ${pid}"
  done
  echo "-------starting--------"
  nohup java -jar -XX:+UseG1GC target/modules-tools-checkanswer.jar > modules-tools-checkanswer.log&
  tail -f modules-tools-checkanswer.log
}
build_dev
run_dev
